program to count number of digits in java